import { NgModule } from '@angular/core'
import { CommonModule } from '@angular/common'
import { ReactiveFormsModule, FormsModule } from '@angular/forms'
import { RouterModule } from '@angular/router'
// delon
import { AlainThemeModule } from '@delon/theme'
import { DelonABCModule } from '@delon/abc'
import { DelonACLModule } from '@delon/acl'
import { DelonFormModule } from '@delon/form'
// i18n
import { TranslateModule } from '@ngx-translate/core'

// #region third libs
import { NgZorroAntdModule, NzAddOnModule } from 'ng-zorro-antd'
import { CountdownModule } from 'ngx-countdown'
import { QRCodeModule } from 'angularx-qrcode'

import { ContentHeaderComponent } from './components/content-header/content-header.component'
import { HeaderBreadcrumbComponent } from './components/content-header/components/header-breadcrumb/header-breadcrumb.component'
import { I18NParams } from './filters/i18n-params.pipe'
import { AmtFormatPipe } from './filters/amt-format.pipe'
import { I18NChanCodePipe } from './filters/i18n-chan-code.pipe'
import { I18NPrefixWithPipe } from './filters/i18n-prefix-with.pipe'
import { CstComponent } from './components/cst-component'
import { SearchComponent } from './components/search/search-component'
import { DetailHeaderComponent } from './components/detail-header/detail-header.component'
import { BaseInfoComponent } from './components/base-info/base-info.component'
import { InfoRowComponent } from './components/info-row/info-row.component'
import { NewPageComponent } from './components/new-page/new-page.component'
import { ProcessBarComponent } from './components/process-bar/process-bar'
import { NewPageDirective } from './components/new-page/new-page.directive'
import { NewPageHeaderComponent } from './components/new-page-header/new-page-header.component'
import { UserProfileComponent } from './components/user-profile/user-profile.component'
import { DetailLogoComponent } from './components/detail-logo/detail-logo.component'
import { DetailRestEditComponent } from './components/detail-rest-edit/detail-rest-edit.component'
import { BtnIconComponent } from './components/btn-icon/btn-icon.component'
import { HistoryExpandTableComponent } from './components/history-expand-table/history-expand-table.component'
import { AamsFormComponent } from './components/aams-form/aams-form.component'
import { AamsInfoComponent } from './components/aams-info/aams-info.component'
import { AamsSelectComponent } from './components/aams-select/aams-select.component'
import { ChannelMerchantSelectComponent } from './components/channel-merchant-select/channel-merchant-select.component'
import { CurrencySelectComponent } from './components/currency-select/currency-select.component'
import { CountrySelectComponent } from '../shared/components/country-select/country-select.component'
import { TradeAmountInputComponent } from '../shared/components/trade-amount-input/trade-amount.component'
import { MccSelectComponent } from '../shared/components/mcc-select/mcc-select.component'
import { RiskControlSelectComponent } from '../shared/components/risk-control-select/risk-control-select.component'
import { DetailChannelComponent } from './components/detail-channel/detail-channel.component'
import { EditPasswordComponent } from './components/edit-password/edit-password.component'
import { TabDetailUsersComponent } from './components/detail-tab-users/detail-tab-users.component'
import { NewUploadFileComponent } from './components/new-upload-file/new-upload-file.component'
import { DetailRestDeleteComponent } from './components/detail-rest-delete/detail-rest-delete.component'
import { DebounceClickDirective } from './directives/debounce-click.directive'
import { StoreService } from 'app/routes/store/store.service'
import { StoreAlinterService } from 'app/routes/store/store-alinter.service'
import { AcquirerService } from 'app/routes/acquirer/acquirer.service'
import { AcquirerAlinterService } from 'app/routes/acquirer/acquirer-alinter.service'
import { CustomInputComponent } from './components/custom-input/custom-input.component'
import { StoreDetailComComponent } from './components/store-detail/store-detail.component'
import { StoreDetailTabTerminalComponent } from 'app/routes/store/detail/tab-terminal/tab-terminal.component'
import { StoreDetailTabQRChannelsComponent } from 'app/routes/store/detail/tab-qr-channels/tab-qr-channels.component'
import { StoreDetailTabCardChannelsComponent } from 'app/routes/store/detail/tab-card-channels/tab-card-channels.component'
import { StoreDetailTabECChannelsComponent } from 'app/routes/store/detail/tab-ec-channels/tab-ec-channels.component'
import { StoreDetailTabSystemComponent } from 'app/routes/store/detail/tab-system/tab-system.component'
import { StoreDetailTabSettlementComponent } from 'app/routes/store/detail/tab-settlement/tab-settlement.component'
import { StoreDetailTabQRFunctionComponent } from 'app/routes/store/detail/tab-qr-function/tab-qr-function.component'
import { StoreDetailTabRiskControlComponent } from 'app/routes/store/detail/tab-risk-control/tab-risk-control.component'
import { StoreDetailTabUsersComponent } from 'app/routes/store/detail/tab-users/tab-users.component'
import { UserSystemComponent } from './components/user-profile/tabs/system/user-system.component'
import { UserAuditComponent } from './components/user-profile/tabs/audit/user-audit.component'
import { OriginTradeInfoComponent } from './components/origin-trade-detail/origin-trade-detail.component'
import { PostriskDetailComponent } from './components/postrisk-detail/postrisk-detail.component'
import { TabRulesComponent } from '../routes/post-risk/detail/tab-rules/tab-rules.component'
import { TabMccComponent } from '../routes/post-risk/detail/tab-mcc/tab-mcc.component'
import { TabRangeComponent } from '../routes/post-risk/detail/tab-range/tab-range.component'

import { HoldDetailComponent } from './components/hold-detail/hold-detail.component'
import { ReleaseDetailComponent } from './components/release-detail/release-detail.component'
import { CustomNumberInputComponent } from './components/custom-number-input/custom-number-input.component'
import { HeaderI18nComponent } from 'app/layout/default/header/components/i18n/i18n.component';

const THIRDMODULES = [
  NgZorroAntdModule,
  NzAddOnModule,
  CountdownModule,
  QRCodeModule,
]
// #endregion

// #region your componets
const COMPONENTS = [
  AamsFormComponent,
  AamsInfoComponent,
  AamsSelectComponent,
  ChannelMerchantSelectComponent,
  CurrencySelectComponent,
  ContentHeaderComponent,
  CountrySelectComponent,
  CustomInputComponent,
  TradeAmountInputComponent,
  HeaderBreadcrumbComponent,
  MccSelectComponent,
  RiskControlSelectComponent,
  SearchComponent,
  DetailHeaderComponent,
  DetailLogoComponent,
  DetailRestEditComponent,
  DetailRestDeleteComponent,
  DetailChannelComponent,
  BaseInfoComponent,
  InfoRowComponent,
  NewPageComponent,
  NewPageHeaderComponent,
  NewUploadFileComponent,
  ProcessBarComponent,
  UserProfileComponent,
  EditPasswordComponent,
  CstComponent,
  BtnIconComponent,
  HistoryExpandTableComponent,
  TabDetailUsersComponent,
  StoreDetailComComponent,
  OriginTradeInfoComponent,
  PostriskDetailComponent,
  TabRulesComponent,
  TabMccComponent,
  TabRangeComponent,
  HoldDetailComponent,
  ReleaseDetailComponent,
  CustomNumberInputComponent,
  HeaderI18nComponent,
]

const COMPONENTS_STORE_TABS = [
  StoreDetailTabTerminalComponent,
  StoreDetailTabQRChannelsComponent,
  StoreDetailTabCardChannelsComponent,
  StoreDetailTabECChannelsComponent,
  StoreDetailTabSystemComponent,
  StoreDetailTabSettlementComponent,
  StoreDetailTabQRFunctionComponent,
  StoreDetailTabRiskControlComponent,
  StoreDetailTabUsersComponent,
]

const COMPONENTS_USER_TABS = [
  UserSystemComponent,
  UserAuditComponent,
]
// your directives
const DIRECTIVES = [
  DebounceClickDirective,
  NewPageDirective,
]
const SELFPIPES = [
  AmtFormatPipe,
  I18NParams,
  I18NChanCodePipe,
  I18NPrefixWithPipe,
]
// #endregion

@NgModule({
  imports: [
    CommonModule,
    FormsModule,
    RouterModule,
    ReactiveFormsModule,
    AlainThemeModule.forChild(),
    DelonABCModule,
    DelonACLModule,
    DelonFormModule,
    TranslateModule,
    // third libs
    ...THIRDMODULES,
  ],
  declarations: [
    // your components
    ...COMPONENTS,
    ...COMPONENTS_STORE_TABS,
    ...COMPONENTS_USER_TABS,
    ...DIRECTIVES,
    ...SELFPIPES,
  ],
  exports: [
    CommonModule,
    FormsModule,
    ReactiveFormsModule,
    RouterModule,
    AlainThemeModule,
    DelonABCModule,
    DelonACLModule,
    DelonFormModule,
    // i18n
    TranslateModule,
    // third libs
    ...THIRDMODULES,
    // your components
    ...COMPONENTS,
    ...DIRECTIVES,
    ...SELFPIPES,
  ],
  providers: [
    { provide: StoreService, useClass: StoreAlinterService },
    { provide: AcquirerService, useClass: AcquirerAlinterService },
  ]
})
export class SharedModule { }
